<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Constants;

use Hyperf\Constants\AbstractConstants;
use Hyperf\Constants\Annotation\Constants;

/**
 * @Constants
 */
class CouponConstants extends AbstractConstants
{
    //状态
    const  COUPON_SEND_WAY_MEMBER = 1; // 用户领取
    const  COUPON_SEND_WAY_PLATFROM= 2; //平台发放


    public const sendMethod = [
        self::COUPON_SEND_WAY_MEMBER   => '用户领取',
        self::COUPON_SEND_WAY_PLATFROM    => '发券宝推送',
    ];

    //状态
    const COUPON_STATUS_NO = 0; // 优惠券禁用
    const COUPON_STATUS_YES= 1; //优惠券启用


    //类型
    const COUPON_TYPE_REDUCTION = 1; // 优惠券满减
    const COUPON_TYPE_DISCOUNT = 2; //优惠券折扣

    //优惠对象
    const COUPON_GOODS_TYPE_ALL = 1; //全部
    const COUPON_GOODS_TYPE_CATEGORY = 3; //根据分类
    const COUPON_GOODS_TYPE_ASSIGN_CATEGORY = 1; //指定分类

    //领取表 使用状态
    const COUPON_RECEIVE_USEING= 1; //已经使用
    const COUPON_RECEIVE_UNUSEING= 0; //未使用
    const COUPON_RECEIVE_DUE= 2;

    //优惠券状态
    const COUPON_DISABLE = 0; // 禁用
    const  COUPON_ENABLE = 1; //启用
    const  COUPON_DEL = 2; //作废
    const COUPON_STATUS_ARRAY = [
        self::COUPON_DISABLE,
        self::COUPON_ENABLE,
        self::COUPON_DEL
    ];

    const COUPON_GOODS_MODEL_TYPE_GOODS = 0;

    // 优惠券使用时间类型
    const COUPON_USE_TIME_FIX = 0;  // 固定时间过期
    const COUPON_USE_TIME_DAY = 1;  // 指定天数过期

    public static $typeName = array(
        self::COUPON_GOODS_TYPE_ALL => '全平台',//全部
        self::COUPON_GOODS_TYPE_CATEGORY => '分类', //全部

    );
    public static $freeType = array(
        self::COUPON_TYPE_DISCOUNT => '满折券', //全部
        self::COUPON_TYPE_REDUCTION => '满减券',//全部
    );

    public static $goodsTypeName = array(
        self::COUPON_GOODS_TYPE_ALL => '全品类',//全部
        self::COUPON_GOODS_TYPE_CATEGORY => '指定品类', //全部

    );


    public static $sendWay = array(
        self::COUPON_SEND_WAY_MEMBER => '用户领取',//全部
        self::COUPON_SEND_WAY_PLATFROM => '平台发放', //全部
    );

    public static $status = array(
        self::COUPON_DISABLE => '停用',
        self::COUPON_ENABLE => '启用',
        self::COUPON_DEL => '作废',
    );

    //金额减免类型
    const COUPON_PRICE_TYPE_PRICE = 0;  // 固定金额

    const COUPON_USER_TYPE_RECEIVE_DEFAULT = 0;//用户领取限制默认为不限制

    /**
     * 是否已结束
     */
    const NO_SEND = 0; // 未结束
    const HAS_SEND = 1; // 已结束
}
